﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Mechanics.ClientDisplayMechanics {
    import flash.geom.*;
    import Mechanics.GameMechanicInterfaces.*;
    import Mechanics.*;
    import Classes.*;
    import Classes.effects.*;

    public class HarvestReadyIndicator implements IClientGameMechanic, IEdgeModifier {

        protected var m_owner:HarvestableResource;
        protected var m_type:String;
        protected var m_previousState:String;
        protected var m_stagePickEffect:StagePickEffect;

        public function updateDisplayObject(_arg1:Number):void{
            if (this.m_previousState != this.m_owner.state){
                if (this.m_owner.state == "grown"){
                    if (!this.m_stagePickEffect){
                        this.m_stagePickEffect = (MapResourceEffectFactory.createEffect(this.m_owner, EffectType.STAGE_PICK) as StagePickEffect);
                        this.m_stagePickEffect.setPickType(StagePickEffect.PICK_1);
                        this.m_stagePickEffect.queuedFloat();
                    } else {
                        this.m_stagePickEffect.setPickType(StagePickEffect.PICK_1);
                        this.m_stagePickEffect.reattach();
                        this.m_stagePickEffect.queuedFloat();
                    };
                } else {
                    if (this.m_stagePickEffect){
                        this.m_stagePickEffect.stopFloat();
                        this.m_stagePickEffect.cleanUp();
                    };
                };
            };
            this.m_previousState = this.m_owner.state;
        }
        public function initialize(_arg1:IMechanicUser, _arg2:MechanicConfigData):void{
            this.m_owner = (_arg1 as HarvestableResource);
            this.m_type = _arg2.type;
        }
        public function isVisitEnabled():Boolean{
            return (false);
        }
        public function isPixelInside(_arg1:Point):Boolean{
            return (false);
        }
        public function getFloatOffset():int{
            return (0);
        }

    }
}//package Mechanics.ClientDisplayMechanics 
